package is2.misc.pipeAndFilter;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;


public class PipeConnector<E> 
implements InPipeConnector<E>, OutPipeConnector<E>
{
	private BlockingQueue<E> queue = new LinkedBlockingQueue<E>();
	
	public void Put(E elem)
	{
		
		try {
			queue.put(elem);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
				
	}
	
	public E Take()
	{
		E elem = null;
		
		try {
			elem = queue.take();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		
		
		return elem;
		
	}
	
	
}
